Skip to content

ci: optimize sparse-checkout and cache to reduce cache size#26692

Merged
hbjORbj merged 8 commits intomainfrom
devin/sparse-checkout-optimization-1768051915
Jan 11, 2026
Merged

ci: optimize sparse-checkout and cache to reduce cache size#26692
hbjORbj merged 8 commits intomainfrom
devin/sparse-checkout-optimization-1768051915

Conversation

@keithwillcode
Copy link
Contributor

@keithwillcode keithwillcode commented Jan 10, 2026

What does this PR do?

Reduces the CI git checkout cache size from ~637 MB to ~86 MB - an 87% reduction.

Root Cause

The first actions/checkout@v4 in the prepare job was doing a full checkout (~535 MB), then dangerous-git-checkout applied sparse-checkout. But files from the first checkout remained on disk because sparse-checkout doesn't remove files that were already checked out.

Fix

  1. Limit first checkout to .github only - The first checkout only needs access to local actions, so we use sparse-checkout: .github to avoid downloading the full repo
  2. Sparse-checkout exclusions - dangerous-git-checkout excludes large files not needed for CI:
    • docs/images/ (~90 MB)
    • packages/app-store/*/static/*.{png,jpg,jpeg,gif} (~101 MB)
  3. Cache exclusions - Exclude apps/web/public/app-store from cache (generated files)

Results

Metric Before After Improvement
Cache Size ~637 MB ~86 MB 87% reduction

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - CI configuration change only.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Merge this PR and observe the cache size in subsequent CI runs
  2. Verify that all CI jobs (lint, type-check, unit tests, E2E tests) still pass
  3. Verified cache size: ~86 MB (down from ~637 MB)

Human Review Checklist

  • Verify the first checkout only needs .github directory to access local actions
  • Verify sparse-checkout patterns are syntactically correct
  • Confirm no CI jobs depend on the excluded files (docs/images, app-store screenshots)
  • Check that SVG icons are correctly preserved (they use .svg extension, not excluded)

Requested by: @keithwillcode
Link to Devin run: https://app.devin.ai/sessions/762cef383ff64e60a5dbd356d6d5759d

Exclude additional large files from CI checkout that are not needed for builds/tests:
- docs/images/ (~90MB) - Documentation images
- packages/app-store/*/static/*.png,jpg,jpeg,gif (~140MB) - App store screenshots

These files are only needed for documentation rendering and app store UI display,
not for CI builds, linting, type checking, or tests.

SVG icons in app-store are preserved as they may be needed for the build.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

The apps/web/public/app-store directory contains ~151MB of static files
copied from packages/app-store/*/static/ during build. These files are
regenerated during yarn install and don't need to be cached.

Combined with the sparse-checkout exclusions, this should significantly
reduce the git checkout cache size.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration bot changed the title ci: optimize sparse-checkout to reduce cache size by ~230MB ci: optimize sparse-checkout and cache to reduce cache size Jan 10, 2026
The first checkout in the prepare job was doing a full checkout (~535 MB),
and then dangerous-git-checkout applied sparse-checkout. But the files from
the first checkout remained on disk because sparse-checkout doesn't remove
files that were already checked out.

By limiting the first checkout to only .github (which is needed to access
the local actions), we avoid downloading the full repo twice. The actual
sparse-checkout with exclusions is then applied by dangerous-git-checkout.

This should reduce the cache from ~504 MB to ~148 MB.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@keithwillcode keithwillcode added the core area: core, team members only label Jan 10, 2026
@keithwillcode keithwillcode self-assigned this Jan 10, 2026
@keithwillcode keithwillcode added this to the v6.1 milestone Jan 10, 2026
@keithwillcode
Copy link
Contributor Author

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

E2E results are ready!

@keithwillcode keithwillcode marked this pull request as ready for review January 10, 2026 18:33
@keithwillcode keithwillcode requested a review from a team as a code owner January 10, 2026 18:33
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

anikdhabal
anikdhabal previously approved these changes Jan 10, 2026
@github-actions
Copy link
Contributor

Devin AI is resolving merge conflicts

This PR has merge conflicts with the main branch. A Devin session has been created to automatically resolve them.

View Devin Session

Devin will:

  1. Merge the latest main into this branch
  2. Resolve any conflicts intelligently
  3. Run lint/type checks to ensure validity
  4. Push the resolved changes

If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself.

Resolved merge conflicts in:
- .github/actions/cache-checkout/action.yml: Kept PR's save/restore mode design
- .github/workflows/pr.yml: Kept PR's sparse-checkout + dangerous-git-checkout approach

Co-Authored-By: unknown <>
@github-actions
Copy link
Contributor

Devin AI is resolving merge conflicts

This PR has merge conflicts with the main branch. A Devin session has been created to automatically resolve them.

View Devin Session

Devin will:

  1. Merge the latest main into this branch
  2. Resolve any conflicts intelligently
  3. Run lint/type checks to ensure validity
  4. Push the resolved changes

If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself.

@devin-ai-integration
Copy link
Contributor

Merge conflicts have been resolved. The conflict in .github/actions/cache-checkout/action.yml was resolved by keeping the PR's redesigned cache save/restore approach (which separates save and restore into explicit modes using actions/cache/save@v4 and actions/cache/restore@v4).

The devin-conflict-resolution label should be removed from this PR.

@keithwillcode keithwillcode marked this pull request as draft January 10, 2026 23:15
@devin-ai-integration devin-ai-integration bot force-pushed the devin/sparse-checkout-optimization-1768051915 branch from 305c86d to cbfb3c0 Compare January 10, 2026 23:27
@pull-request-size pull-request-size bot added size/S and removed size/M labels Jan 10, 2026
@devin-ai-integration
Copy link
Contributor

I've corrected the merge conflict resolution. The previous resolution incorrectly kept the separate save/restore approach, but I've now properly resolved it to:

  1. Keep main's combined actions/cache@v4 design (from PR fix: refactor cache-checkout to use actions/cache@v4 with fallback #26702)
  2. Add the sparse-checkout exclusions from this PR to both cache-checkout and dangerous-git-checkout:
    • !/docs/images/
    • !packages/app-store/*/static/*.png
    • !packages/app-store/*/static/*.jpg
    • !packages/app-store/*/static/*.jpeg
    • !packages/app-store/*/static/*.gif
  3. Add !apps/web/public/app-store to the cache paths
  4. Keep the sparse-checkout: .github optimization in pr.yml

The devin-conflict-resolution label should be removed from this PR.

@keithwillcode keithwillcode marked this pull request as ready for review January 11, 2026 09:12
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@hbjORbj hbjORbj merged commit 784db75 into main Jan 11, 2026
112 of 116 checks passed
@hbjORbj hbjORbj deleted the devin/sparse-checkout-optimization-1768051915 branch January 11, 2026 10:17
Anshumancanrock pushed a commit to Anshumancanrock/cal.com that referenced this pull request Jan 12, 2026
…6692)

* ci: optimize sparse-checkout to reduce cache size by ~230MB

Exclude additional large files from CI checkout that are not needed for builds/tests:
- docs/images/ (~90MB) - Documentation images
- packages/app-store/*/static/*.png,jpg,jpeg,gif (~140MB) - App store screenshots

These files are only needed for documentation rendering and app store UI display,
not for CI builds, linting, type checking, or tests.

SVG icons in app-store are preserved as they may be needed for the build.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* ci: exclude generated app-store static files from cache

The apps/web/public/app-store directory contains ~151MB of static files
copied from packages/app-store/*/static/ during build. These files are
regenerated during yarn install and don't need to be cached.

Combined with the sparse-checkout exclusions, this should significantly
reduce the git checkout cache size.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* ci: fix sparse-checkout by limiting first checkout to .github only

The first checkout in the prepare job was doing a full checkout (~535 MB),
and then dangerous-git-checkout applied sparse-checkout. But the files from
the first checkout remained on disk because sparse-checkout doesn't remove
files that were already checked out.

By limiting the first checkout to only .github (which is needed to access
the local actions), we avoid downloading the full repo twice. The actual
sparse-checkout with exclusions is then applied by dangerous-git-checkout.

This should reduce the cache from ~504 MB to ~148 MB.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: update cache-checkout to include sparse-checkout exclusions and fix pr.yml compatibility

Co-Authored-By: unknown <>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – cal-companion January 13, 2026 08:05 Inactive
@vercel vercel bot temporarily deployed to Preview – dev January 13, 2026 08:06 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants